class_name Buff

var model:ConfigModel
var id
var fighter
var level
var skill
var next_time = 0
var times = 0
var cooldown_time = 0
var effect


func _init(_model, _fighter, _skill: SkillCmdC.Skill, _level=0):
	model = _model
	id = model.get(C.BuffAttrKey.id)
	fighter = _fighter
	skill = _skill
	var skl = _skill.get(C.SkillAttrKey.level)
	level = _level if _level else skl if skl else 1


func get(key):
	var local = .get(key)
	return local if local else model.get(key)


func is_over():
	var t = get(C.BuffAttrKey.fireMaxTimes)
	return t!=-1 && times >= t

